7668 release note
mt7668.mp1-1714-v1.2.0 
cert: Add power cap ie in assoc/reassoc req 
--֤ڹ/¹ʱӹ
˵֤⣬ʱ޷֤
cert: Fix TGac 5.2.46 STBC Receive Test fail 
--֤޸TGac 5.2.46 STBCղʧ
˵֤⣬ʱ޷֤
cfg80211: Fix incorrect max_scan_ssids number
--cfg80211޸ȷmax_scan_ssidsֵ
˵max_scan_ssidsӰɨܣҵͬʱɨ㲥ssidssidʱmax_scan_ssidsýСʱɨᱨɨ󡣾ֵΪ1ѾĳһƣĿǰúΪ4
cfg80211: Fix compile errors for linux-4.1.y 
--cfg80211޸linux-4.1.y汾ںϵı
˵4.1ں˵ı⣬롣
core: Fix PDMA setting and refine wifi power-on function 
--core޸PDMAòWiFiϵ繦
˵PdmadmaڴֱӴȡڿٴݣСCPUʹ,wifi power-onӦʱʱŻ
misc: Change noise info source of driver "stat" result
--statϢԴ 
˵mtkdebugʱҪĲοϢ
misc: Fix random OID timeout in connected idle
--޸ӵĿģʽеOIDʱ
˵ͻ汩¶⣬롣
misc: add linux-4.9 support 
--linux-4.9֧
˵ں˵֧֣롣
misc: Remove BOW (BT over WiFi) feature 
--ƳBOWBT over WiFi
˵ƳѾ˼QC,?Ŀǰ]зֵ쳣Ӱ, BTʹÛ]}
misc: Fix kernel crash while suspend due to no MT7668 dongle inserted
--޸ûвmt7668 dongle ɵsuspendʱںcrash
˵dongleʱ⣬롣
misc: Fix compile error if IPV6 is enabled as module 
--޸IPV6Ϊģʱı
˵󣬽롣
misc: Add build support for Linux backports-3.14-1 mtkȷϣ
--ӶLinux 3.14-1ֲı֧
˵ں˵֧֣Ժ롣
misc: Add more config items in Makefile.x86 
--Makefile.x86Ӹ
˵x86ƽ̨޸ģԺ롣
perf: Fix USB probe fail on some laptop PC 
--perf޸һЩʼǱϵUSB̽ʧ
˵usb dongle⣬Ժ롣
regd: Fix crash problem of TxPwrLimit when in single band 
--regd޸TxPwrLimitڵƵʱı
˵TxPwrLimit.datΪļڲĴǰ޸ĳƵεĹʲȻĿǰ7668þΪĬֵǲųƵĿܣ롣
Sdiofix command port Tx overflow issue 
--sdio޸˿Tx
˵˵ǷʱĳȳƣӦӰ졣
sdio: Add support MMC_PM_WAKE_SDIO_IRQ 
--sdioӶMMC_PM_WAKE_SDIO_IRQ֧
˵пͻMMC_PM_WAKE_SDIO_IRQûõӦӰ졣
softap: apply cfg80211 setting for P2PGO 
--softapP2PGOcfg80211
˵softapģʽP2PServerʱcfg80211ã롣
softap: add dfs shut down flow 
--softapdfsر
˵softapģʽdfs̬Ƶѡ񣩵Ĺرչܡ
tx: refine WMM set CMD usage between drv and fw 
--txĽdriverFW֮WMMCMDʹ
˵WMM߶ý壩ݣаƵbest effortԼbackgroundݽзּȼߵȱ֤䡣롣
mt7668.mp1-1714-v1.2.1 
ate: Fix FFT cannot work on non-PC Linux platform 
--ate޸FFTڷPC Linuxƽ̨е
˵ateУ׼أ롣
cfg80211: Fix Android O CTS item 
--cfg80211޸Android O cts
˵޸8.0cts뽨롣
cfg80211get_station will query wlan0 address also
--cfg80211get_stationҲѯwlan0ַ
˵ͬ
misc: Fix coding style 
--޸
softap: add 802.11w PMF mandatory item for AP role
--softapΪAPɫ802.11w PMFǿ
˵softapģʽµ⣬
oftap: Fix cannot start hostapd with WPA
--softap޸޷ʹWPAhostapd
˵֮ǰsoftap޷޸ģѺ롣
softap: Fix WEP key assign bug
--softap޸WEPԿ
˵softapWEPʽʱ⣬롣
softap: Fix rekey and ping fail 
 	--softap޸Կpingʧܵ
˵֮ǰ4.4⣬Ѻ롣
tdls: Fix skb memory overwrite issue
--tdls ޸skbڴ渲
˵tdlsģʽ´ڴй¶⣬롣
tx: Fix TX handle too late issue
--tx޸TX handle̫
˵޸txʱ⣬ܹtxʣ֤롣
wowlan: Support EAPOL offload in active mode or wow mode  
--wowlanڻģʽwowģʽ֧EAPOLж
˵wifiģʽ⣬
wowlan: automatically enter power mode when suspend in wow state 
--wowlanwow״̬ʱԶԴģʽ
˵wifiģʽ⣬

Ȿֶ˹롢p2p޸ģwifiʱ⣬mtkѾ޸ģⲿ޸ûк롣
룺
commit af22923502fd84d4bf2714dcfb9ade731d7e4330
Author: 6407001065 <zhang.lei30@zte.com.cn>
Date:   Fri Jul 21 11:20:00 2017 +0800

    add country code for wifi
    
    Ͼġϡandroid7.1ͨгǷҪߣ
    Ƿм߲Ʒϵޡ
    ϸwifiá
    ӿڼܱӰޡ
    Էinsmodʱӹ
    Բۣok߲ϢԲ顿

diff --git a/MT6632_WIFI_DRV/7668_firmware/wifi.cfg b/MT6632_WIFI_DRV/7668_firmware/wifi.cfg
index c43614d..4021123 100755
--- a/MT6632_WIFI_DRV/7668_firmware/wifi.cfg
+++ b/MT6632_WIFI_DRV/7668_firmware/wifi.cfg
@@ -55,4 +55,3 @@ SetChip0 KeepFullPwr 0
 TdlsBufferSTASleep 0
 ChipResetRecover 0
 CalTimingCtrl 1
-Country IN
diff --git a/MT6632_WIFI_DRV/drv_wlan/MT6632/wlan/common/wlan_lib.c b/MT6632_WIFI_DRV/drv_wlan/MT6632/wlan/common/wlan_lib.c
old mode 100755
new mode 100644
index 3efcd7f..a794af9
--- a/MT6632_WIFI_DRV/drv_wlan/MT6632/wlan/common/wlan_lib.c
+++ b/MT6632_WIFI_DRV/drv_wlan/MT6632/wlan/common/wlan_lib.c
@@ -7012,13 +7012,32 @@ VOID wlanCfgSetDebugLevel(IN P_ADAPTER_T prAdapter)
 	}
 
 }
+#ifdef CFG_SUPPORT_INSMOD_COUNTRYCODE
+BOOLEAN getInsmodCountryArg(char *pucValue)
+{
+	ASSERT(ginsmodcountrycode);
+	ASSERT(pucValue);
 
+	if(kalStrLen(ginsmodcountrycode) > 0)
+	{
+		kalStrnCpy(pucValue, ginsmodcountrycode, WLAN_CFG_VALUE_LEN_MAX - 1);
+		DBGLOG(INIT, ERROR, "pucValue = %s ,ginsmodcountrycode=%s \n",
+			   pucValue,ginsmodcountrycode);
+		return TRUE;
+	}
+	return FALSE;
+}
+#endif
 VOID wlanCfgSetCountryCode(IN P_ADAPTER_T prAdapter)
 {
 	CHAR aucValue[WLAN_CFG_VALUE_LEN_MAX];
 
 	/* Apply COUNTRY Config */
-	if (wlanCfgGet(prAdapter, "Country", aucValue, "", 0) == WLAN_STATUS_SUCCESS) {
+	if (
+#ifdef CFG_SUPPORT_INSMOD_COUNTRYCODE
+    (getInsmodCountryArg(aucValue)==TRUE) || 
+#endif
+	(wlanCfgGet(prAdapter, "Country", aucValue, "", 0) == WLAN_STATUS_SUCCESS)) {
 		prAdapter->rWifiVar.rConnSettings.u2CountryCode =
 		    (((UINT_16) aucValue[0]) << 8) | ((UINT_16) aucValue[1]);
 
diff --git a/MT6632_WIFI_DRV/drv_wlan/MT6632/wlan/include/config.h b/MT6632_WIFI_DRV/drv_wlan/MT6632/wlan/include/config.h
old mode 100755
new mode 100644
index 7664fd6..56dc0f4
--- a/MT6632_WIFI_DRV/drv_wlan/MT6632/wlan/include/config.h
+++ b/MT6632_WIFI_DRV/drv_wlan/MT6632/wlan/include/config.h
@@ -950,6 +950,8 @@
  */
 #define CFG_SUPPORT_80211_LLC_VLAN 0
 
+
+#define CFG_SUPPORT_INSMOD_COUNTRYCODE 1    //zhen.ma
 /*******************************************************************************
 *                             D A T A   T Y P E S
 ********************************************************************************
diff --git a/MT6632_WIFI_DRV/drv_wlan/MT6632/wlan/mgmt/reg_rule.c b/MT6632_WIFI_DRV/drv_wlan/MT6632/wlan/mgmt/reg_rule.c
old mode 100755
new mode 100644
index 37a4e54..bf5899e
--- a/MT6632_WIFI_DRV/drv_wlan/MT6632/wlan/mgmt/reg_rule.c
+++ b/MT6632_WIFI_DRV/drv_wlan/MT6632/wlan/mgmt/reg_rule.c
@@ -242,6 +242,30 @@ const struct ieee80211_regdomain regdom_in = {
 	REG_RULE_LIGHT(5745-10, 5825+10, 40, 0) }
 };
 
+const struct ieee80211_regdomain regdom_id = {
+	.n_reg_rules = 1,
+	.reg_rules = {
+	/* channels 1..11 */
+	REG_RULE_LIGHT(2412-10, 2462+10, 40, 0) }
+};
+
+const struct ieee80211_regdomain regdom_th = {
+	.n_reg_rules = 6,
+	.reg_rules = {
+	/* channels 1..11 */
+	REG_RULE_LIGHT(2412-10, 2462+10, 40, 0),
+	/* channels 12,13 */
+	REG_RULE_LIGHT(2467-10, 2472+10, 40, 0),
+	/* channels 36..48 */
+	REG_RULE_LIGHT(5180-10, 5240+10, 40, 0),
+	/* channels 52..64 */
+	REG_RULE_LIGHT(5260-10, 5320+10, 80, NL80211_RRF_DFS),
+	/* channels 100..140 */
+	REG_RULE_LIGHT(5500-10, 5700+10, 160, NL80211_RRF_DFS),
+	/* channels 149..165 */
+	REG_RULE_LIGHT(5745-10, 5825+10, 40, 0) }
+};
+
 /*
  * Step2. Decclare struct mtk_regdomain
  */
@@ -271,11 +295,21 @@ const struct mtk_regdomain my_regdom_cz = {
 	.prRegdRules = &regdom_cz_nl
 };
 
-const struct mtk_regdomain my_regdom_in = {
+const struct mtk_regdomain my_regdom_in = {        //India
 	.country_code = "IN",
 	.prRegdRules = &regdom_in
 };
 
+const struct mtk_regdomain my_regdom_id = {        //Indonesia
+	.country_code = "ID",
+	.prRegdRules = &regdom_id
+};
+
+const struct mtk_regdomain my_regdom_th = {        //Thailand
+	.country_code = "TH",
+	.prRegdRules = &regdom_th
+};
+
 /*
  * Step3. Register to table
  */
@@ -287,6 +321,8 @@ const struct mtk_regdomain *g_prRegRuleTable[] = {
 	&my_regdom_nl,
 	&my_regdom_cz,
 	&my_regdom_in,
+	&my_regdom_id,
+	&my_regdom_th,
 	NULL /* this NULL SHOULD be at the end of the array */
 };
 
diff --git a/MT6632_WIFI_DRV/drv_wlan/MT6632/wlan/os/linux/gl_init.c b/MT6632_WIFI_DRV/drv_wlan/MT6632/wlan/os/linux/gl_init.c
old mode 100755
new mode 100644
index b47df38..ab3fc9f
--- a/MT6632_WIFI_DRV/drv_wlan/MT6632/wlan/os/linux/gl_init.c
+++ b/MT6632_WIFI_DRV/drv_wlan/MT6632/wlan/os/linux/gl_init.c
@@ -118,9 +118,16 @@ MODULE_LICENSE("Dual BSD/GPL");
 char *gprifnamesta = "";
 char *gprifnamep2p = "";
 char *gprifnameap = "";
+#ifdef CFG_SUPPORT_INSMOD_COUNTRYCODE 
+char *ginsmodcountrycode = "";
+#endif
 module_param_named(sta, gprifnamesta, charp, 0);
 module_param_named(p2p, gprifnamep2p, charp, 0);
 module_param_named(ap, gprifnameap, charp, 0);
+#ifdef CFG_SUPPORT_INSMOD_COUNTRYCODE 
+module_param_named(mtkCountryCode, ginsmodcountrycode, charp, 0);
+#endif
+
 #endif /* CFG_DRIVER_INF_NAME_CHANGE */
 
 /* NIC interface name */
diff --git a/MT6632_WIFI_DRV/drv_wlan/MT6632/wlan/os/linux/include/gl_os.h b/MT6632_WIFI_DRV/drv_wlan/MT6632/wlan/os/linux/include/gl_os.h
old mode 100755
new mode 100644
index 758830a..3e64023
--- a/MT6632_WIFI_DRV/drv_wlan/MT6632/wlan/os/linux/include/gl_os.h
+++ b/MT6632_WIFI_DRV/drv_wlan/MT6632/wlan/os/linux/include/gl_os.h
@@ -969,6 +969,10 @@ extern struct net_device *gPrDev;
 extern char *gprifnameap;
 extern char *gprifnamep2p;
 extern char *gprifnamesta;
+#ifdef CFG_SUPPORT_INSMOD_COUNTRYCODE 
+extern char *ginsmodcountrycode ;
+#endif
+
 #endif /* CFG_DRIVER_INF_NAME_CHANGE */
 
 extern void wlanRegisterNotifier(void);

P2p
commit e5f943d08c5a1b5fa92d94265d9db063564f98a3
Author: 10158804 <zeng.liang101@zte.com.cn>
Date:   Fri Jul 28 18:14:14 2017 +0800

    reSolve the problem of Wi-Fi Direct Test
    
    󡿡Android7.1гǷҪߣ
    Ƿм߲Ʒϵޡ
    ϸCTS VerifierʧWi-Fi Direct Test
    ӿڼܱӰޡ
    Է޸ĺCTS VerifierʧWi-Fi Direct Testͨ 
    Բۣok߲ϢԲ顿

diff --git a/MT6632_WIFI_DRV/drv_wlan/MT6632/wlan/os/linux/gl_p2p.c b/MT6632_WIFI_DRV/drv_wlan/MT6632/wlan/os/linux/gl_p2p.c
old mode 100755
new mode 100644
index 50fd7ea..22ce523
--- a/MT6632_WIFI_DRV/drv_wlan/MT6632/wlan/os/linux/gl_p2p.c
+++ b/MT6632_WIFI_DRV/drv_wlan/MT6632/wlan/os/linux/gl_p2p.c
@@ -1551,7 +1551,7 @@ int p2pDoIOCTL(struct net_device *prDev, struct ifreq *prIfReq, int i4Cmd)
 		return -EINVAL;
 	}
 
-	if (i4Cmd == IOCTL_GET_DRIVER)
+	if (i4Cmd == IOCTL_GET_DRIVER || i4Cmd == SIOCDEVPRIVATE + 1)
 		ret = priv_support_driver_cmd(prDev, prIfReq, i4Cmd);
 	else if (i4Cmd == SIOCGIWPRIV)
 		ret = mtk_p2p_wext_get_priv(prDev, &rIwReqInfo, &(prIwReq->u), NULL);


ֽһ޷ѵ⡣޸£Ҫmt7668_patch_e2_hdr.bin޸ġ
diff --git a/bluetooth/bt_driver/mtk7668/btmtk_main.c b/bluetooth/bt_driver/mtk7668/btmtk_main.c
index 771c4d8..2fd71b4 100644
--- a/bluetooth/bt_driver/mtk7668/btmtk_main.c
+++ b/bluetooth/bt_driver/mtk7668/btmtk_main.c
@@ -384,7 +384,10 @@ int btmtk_remove_card(struct btmtk_private *priv)
 
 
         BTMTK_INFO("%s stop main_thread\n", __func__);
-        kthread_stop(priv->main_thread.task);
+
+        if(!PTR_ERR(priv->main_thread.task))
+            kthread_stop(priv->main_thread.task);
+
         BTMTK_INFO("%s stop main_thread done\n", __func__);
 #ifdef CONFIG_DEBUG_FS
         /*btmtk_debugfs_remove(hdev);*/
diff --git a/bluetooth/bt_driver/mtk7668/btmtk_sdio.c b/bluetooth/bt_driver/mtk7668/btmtk_sdio.c
index b5aa886..8255fb5 100644
--- a/bluetooth/bt_driver/mtk7668/btmtk_sdio.c
+++ b/bluetooth/bt_driver/mtk7668/btmtk_sdio.c
@@ -1445,7 +1445,7 @@ static int btmtk_sdio_process_int_status(struct btmtk_private *priv)
         ret = btmtk_sdio_readl(CHISR, &u32ReadCRValue);
         BTMTK_DBG("%s check TX_EMPTY CHISR 0x%08x\n", __func__, u32ReadCRValue);
         if (TX_EMPTY&u32ReadCRValue) {
-            ret = btmtk_sdio_writel(CHISR, TX_EMPTY);
+            ret = btmtk_sdio_writel(CHISR, (TX_EMPTY | TX_COMPLETE_COUNT));
             priv->btmtk_dev.tx_dnld_rdy = true;
             BTMTK_DBG("%s set tx_dnld_rdy 1\n", __func__);
         }

